package com.superwindcloud
import  Diff._
import java.util as jutil
import scala.annotation.{nowarn, tailrec}
import scala.collection.immutable.ArraySeq
import scala.collection.IndexedSeqView
import scala.language.implicitConversions
import scala.reflect.ClassTag
import scala.util.Try
import  Op.Delete
import  Op.Insert
import  Op.Move
@main
def example(): Unit = {
  // create a 'diff' between two `IndexedSeq[T]`
  val diff = Diff(
    "the base sequence",
    "the target sequence"
  )

// 从 `base` 到 `target` 所需的所有删除操作
  val deletes: Seq[Diff.Op.Delete] = diff.deletes
   println(deletes.toSeq) // the as sequence

 // 从 `base` 到 `target` 所需的所有插入操作
  val inserts: Seq[Diff.Op.Insert] = diff.inserts
   println(inserts)
  val delIns: Seq[Diff.Op.DelIns] = diff.delInsOps
  println(delIns)
  val delInsSorted: Seq[Diff.Op.DelIns] = diff.delInsOpsSorted // same but sorted by index
  println(delInsSorted)


  val  patch = diff.patch
  println(patch)
}